﻿@model OnlineStore.Web.Models.Orders.IndexOrderViewModel
@{
    ViewData["Title"] = "Index";
    Layout = "_Layout1";
}

<!--标签-->
<ul class="nav nav-tabs" role="tablist">
    <li class="active">
        <a href="#tab-WaitToDeal" role="tab" data-toggle="tab">未发货</a>
    </li>
    <li>
        <a href="#tab-Shipped" role="tab" data-toggle="tab">已发货</a>
    </li>
    <li>
        <a href="#tab-Completed" role="tab" data-toggle="tab">已完成</a>
    </li>
</ul>


<!--标签的内容-->
<div class="tab-content">
    <div class="tab-pane active" id="tab-WaitToDeal">

        <div class="CarMainPart table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <td>订单号</td>
                        <td>下单时间</td>
                        <td>商品数量</td>
                        <td>取消订单</td>
                    </tr>
                </thead>

                <tbody>
                    @foreach (var order in Model.wait)
                    {
                        <tr>
                            <td style="padding-top:25px;">@order.Id</td>
                            <td style="padding-top:25px">@order.CreateTime</td>
                            <td style="padding-top:25px;">@order.ProductInOrders.Count </td>

                            <td style="padding-top:25px;">
                                <form asp-action="Delete" asp-controller="Cart" method="post">
                                    <button type="submit" class="btn btn-danger" asp-controller="Orders" asp-action="Delete" asp-route-OrderId="@order.Id">删除</button>
                                </form>
                            </td>

                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
    <div class="tab-pane" id="tab-Shipped">
        <div class="CarMainPart table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <td>订单号</td>
                        <td>下单时间</td>
                        <td>商品数量</td>
                    </tr>
                </thead>

                <tbody>
                    @foreach (var order in Model.Shipped)
                    {
                        <tr>
                            <td style="padding-top:25px;">@order.Id</td>
                            <td style="padding-top:25px">@order.CreateTime</td>
                            <td style="padding-top:25px;">@order.ProductInOrders.Count </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
    <div class="tab-pane" id="tab-Completed">
        <div class="tab-pane active" id="tab-WaitToDeal">

            <div class="CarMainPart table-responsive">
                <table class="table">
                    <thead>
                        <tr>
                            <td>订单号</td>
                            <td>完成时间</td>
                            <td>商品数量</td>
                            <td>评论</td>
                        </tr>
                    </thead>

                    <tbody>
                        @foreach (var order in Model.completed)
                        {
                            <tr>
                                <td style="padding-top:25px;">@order.Id</td>
                                <td style="padding-top:25px">@order.DoneTime</td>
                                <td style="padding-top:25px;">@order.ProductInOrders.Count </td>

                                <td style="padding-top:25px;">
                                    <form asp-action="Delete" asp-controller="Cart" method="post">
                                        <button type="submit" class="btn btn-danger" asp-controller="Orders" asp-action="SendComment" asp-route-OrderId="@order.Id" >评论</button>
                                    </form>
                                </td>

                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


